<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Baocao extends MY_Controller {

	public $data 	= 	array();
 	public $_template = array();
	public function __construct() {
		//parent::Controller();
		parent::__construct(); //for CI 2.x users 
		$this->load->module_model('member', 'qlsv_model', 'hocphi');
		$this->load->module_language('member', 'qlsv');
		$this->load->helper('text');
		$this->user = $this->access->get_user();
		$this->load->helper('url');
		$this->access->restrict();
	}
	
 
	public function index($duration='') 
	{
		//$this->access->restrict('Member.Baocao.Index');
		$data['ItemID'] = 'User';
		$data['title'] = 'Bảng thu học phí';
		$data['description'] = 'Bảng thu học phí';
		
		$this->access->restrict();
		$this->load->library('basic_library');
		$this->load->library('pagination');
		
		$config = array();
		$config['base_url'] = base_url().'member/hocphi/index/';
		$config['total_rows'] = $this->hocphi->count_all_hocphi();
		$config['per_page'] = 30;
		$config['uri_segment'] = 4;
		$config['num_links'] = 5;
		$config['first_link'] = 'First';
        $config['last_link'] = 'Last';
        $config['next_link'] = 'Next';
        $config['prev_link'] = 'Prev';
		$this->pagination->initialize($config);
		$page = ($this->uri->segment(4))? $this->uri->segment(4):0;
		
		$data['allhocphi'] = $this->hocphi->get_list_hoc_phi_duration($duration);
		$data['totalhocphi']= $this->hocphi->get_total_hoc_phi_duration($duration);
		$data['links'] = $this->pagination->create_links();		
		switch ($duration)
		{
			case 'yesterday': $data['duration'] = ' hôm qua'; break;
			case 'thismonth': $data['duration'] = ' tháng này'; break;
			case 'thisyear': $data['duration'] = ' năm nay'; break;
			case 'quater': $data['duration'] = ' quý này'; break;
			case 'quater': $data['duration'] = ' quý này'; break;
			default: $data['duration'] = ' hôm nay';
		}
		$this->_template['page']	= 'users/baocao/list';
		$this->system_library->load($this->_template['page'], $data);
	}
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/products.php */